package com.yxzc.chapter06.constructor

/**
 *
 * @author wu
 * @create 2021-09-08-16:46 
 */
object ConDemo01 {

  def main(args: Array[String]): Unit = {
    var per = new Persion("wokr", 1);
    println(per)
  }
}

class Persion(initName: String, inAge: Int) {
  var name: String = initName
  var age: Int = inAge
  age += 10
  println("2~~~")

  override def toString: String = {
    "name= " + this.name + "\t age =" + this.age
  }

  println("ok~")
  println("age= " + age);

}